**************Estimate the Structural Probit for Self-Employment********************
** sum command for average prediction of SE, dta files for tax
*scenarios in file
clear
clear matrix
 set mem 200m
set matsiz 88

use  "/Users/dgordon/Desktop/Self-Employment/99analysis", clear
use "/Users/dgordon/Desktop/Self-Employment/00analysis", clear
use "/Users/dgordon/Desktop/Self-Employment/01analysis", clear
use "/Users/dgordon/Desktop/Self-Employment/02analysis", clear 
use "/Users/dgordon/Desktop/Self-Employment/03analysis", clear
use "/Users/dgordon/Desktop/Self-Employment/04analysis", clear
use  "/Users/dgordon/Desktop/Self-Employment/05analysis", clear
 

 
append using  "/Users/dgordon/Desktop/Self-Employment/04analysis"
append using  "/Users/dgordon/Desktop/Self-Employment/03analysis"
append using  "/Users/dgordon/Desktop/Self-Employment/02analysis"
append using  "/Users/dgordon/Desktop/Self-Employment/01analysis"
append using  "/Users/dgordon/Desktop/Self-Employment/00analysis"
append using  "/Users/dgordon/Desktop/Self-Employment/99analysis"

sum selfemp
gen D99=0
replace D99=1 if date==1999
gen D00=0
replace D00=1 if date==2000
gen D01=0
replace D01=1 if date==2001
gen D02=0
replace D02=1 if date==2002
gen D03=0
replace D03=1 if date==2003
gen D04=0
replace D04=1 if date==2004
gen D05=0
replace D05=1 if date==2005

 replace inva27 = inva27-inva42
 replace capgn27 = capgn27-capgn42
gen hhother = inva27+capgn27
gen NetISE = (btearningSE+other)-tottaxSE
gen NetIE = (btearningE+other)-tottaxWS
sum NetISE NetIE
gen NetI = NetISE/NetIE


gen NetIncdif = ln(NetI)
gen NetIncdif2 = NetI-1
 






gen Dtax =0
replace Dtax=1 if date>=2001
gen DTnetincdif = Dtax*NetIncdif
gen DTdifD = Dtax*taxdif_dfU
gen DTdifH = Dtax*taxdif_dfD

 

sum selfemp
*
*tax convexity
gen TOTtaxdif = taxdif_dfU+taxdif_dfD

*
************************
*

probit selfemp    inva27 capgn27  yrschl18   ecage26 age2 health male married kids wksuem28 blucol  service    newfoundland pei novascotia newbrunswick quebec manitoba saskatchewan  alberta bc D00-D05   NetIncdif TOTtaxdif, vce (boots, rep(1000))
